Paraxial Ray Tracing

The raytrace function provides methods for tracing over a given system or lens while the transfer function provides convenience methods for working with transfer matrices.

Lenses can be computed either by passing a surface matrix, as in Lens(surfaces), or directly by using the Lens(lens_matrix, refractive_indices) constructor.

# telephoto objective comprised of two thin lenses in air
lens = Lens([
    # t/n   # power
    0.0      0.02
    25.0    -0.02
], ones(3))

y, nu = 1.0, 0.0

raytrace(lens, y, nu)
ParaxialRay{Tangential}.yu:
3×2 Matrix{Float64}:
 1.0   0.0
 1.0  -0.02
 0.5  -0.01
# object height
h = 10.0
# signed object distance from vertex
s = -100.0
julia> raytrace(system, h, s)RayBasis
(ParaxialRay{Marginal}, ParaxialRay{Chief})
(; f) = system
FFL, BFL = system.EFFD, system.EBFD
# positive distance from front vertex
τ = f + abs(FFL)
# positive distance from back vertex
τ′ = f + BFL
u = 0.07

# 2f-2f system
transfer(system.M, [0.0, u], τ, τ′)
2-element Vector{Float64}:
 -2.984279490192421e-15
 -0.07000000000000003

In addition, general transfer matrices can be directly constructed by passing a Lens to the TransferMatrix constructor.